Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.sw
Class Library.LibraryLoader

    java.lang.Object
      org.xml.sax.helpers.DefaultHandler
          rdlc.sw.Library.LibraryLoader

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

Enclosing class:
  Library

    protected class Library.LibraryLoader

extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.ErrorHandler

This class does the actual XML parsing and loading. It is separated from the main library because it is only needed to read the config file in.

Version:
  $Revision: 1.21 $
Author:
  Greg Gibeling

Field Summary
`static java.lang.String` | `ATTR_ACCESS` Attribute name for the access (protection) on a field.
`static java.lang.String` | `ATTR_ARRAY` Attribute name for the array specifier on a variable or method.
`static java.lang.String` | `ATTR_NAME` Attribute name for the element name.
`static java.lang.String` | `ATTR_PROTOTYPE` Attribute name for the prototype method flag.
`static java.lang.String` | `ATTR_SOURCE` Attribute name for the source file.
`static java.lang.String` | `ATTR_SYNCHRONIZED` Attribute name for the synchronized method flag.
`static java.lang.String` | `ATTR_TYPE` Attribute name for the type of a variable or method.
`protected java.lang.String` | `cdata` Accumulated character data.
`static java.lang.String` | `ELEM_CLASS` Element name for a library class.
`static java.lang.String` | `ELEM_ENGINE` Element name for a class which implements an engine.
`static java.lang.String` | `ELEM_FILE` Element name for a library file.
`static java.lang.String` | `ELEM_LINK` Element name for a class which implements a link.
`static java.lang.String` | `ELEM_METHOD` Element name for a method on a library class.
`static java.lang.String` | `ELEM_NAMESPACE` Element name for a namespace.
`static java.lang.String` | `ELEM_PARENT` Element name for an inheritance specification.
`static java.lang.String` | `ELEM_REQUIRES` Element name for a library class or file depedancy.
`static java.lang.String` | `ELEM_ROOT` Element name for the root namespace.
`static java.lang.String` | `ELEM_TYPEARG` Element name for a type argument or template parameter.
`static java.lang.String` | `ELEM_VARIABLE` Element name for a variable either as a method argument or a field.
`protected java.lang.String` | `engineName` The name of the engine being loaded.
`protected Instance` | `instance` The instance representing the element currently being parsed.
`protected java.lang.String` | `linkName` The name of the link being loaded.
`protected org.xml.sax.Locator` | `locator` Locator provided by the XML parser to get line numbers and such.
`protected Namespace` | `namespace` Current context during XML parsing.
`protected java.lang.String` | `path` The path to the XML resource.
`protected java.lang.String` | `resourceName` The name of the XML resource.
`protected Namespace` | `rootNamespace` The root namespace of the hierarchy.

Constructor Summary
`Library.LibraryLoader(java.lang.String _resourceName, boolean tryResource, Namespace _rootNamespace, java.lang.String _schemaName, Log errorLog)` Standard constructor.

Method Summary
`void` | `characters(char[] buf, int offset, int len)` CData accumulation routine.
`void` | `endDocument()`
`void` | `endElement(java.lang.String URI, java.lang.String localName, java.lang.String qualifiedName)` Simple cleanup routine to handle the end of an element.
`void` | `error(org.xml.sax.SAXParseException exception)` Simply throws the exception to abort parsing.
`void` | `fatalError(org.xml.sax.SAXParseException exception)` Simply throws the exception to abort parsing.
`Field.Access` | `lookupAccess(java.lang.String accessName)` Parse a given string to get the access enum that that string corresponds to.
`int` | `lookupArray(java.lang.String arrayBound)` Parse an array bound specifier.
`java.lang.Integer` | `lookupType(java.lang.String vartype)` Parse a simple variable type into it's internal bitwidth style representation.
`void` | `setDocumentLocator(org.xml.sax.Locator _locator)`
`void` | `startDocument()`
`void` | `startElement(java.lang.String URI, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes)` Element start handler, responsible for creating namespaces, library classes and library files.
`void` | `warning(org.xml.sax.SAXParseException exception)` Simply throws the exception to abort parsing.

Methods inherited from class org.xml.sax.helpers.DefaultHandler
`endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ELEM_ROOT

    public static final java.lang.String ELEM_ROOT

  Element name for the root namespace.

  See Also:
    Constant Field Values

### ELEM_NAMESPACE

    public static final java.lang.String ELEM_NAMESPACE

  Element name for a namespace.

  See Also:
    Constant Field Values

### ELEM_CLASS

    public static final java.lang.String ELEM_CLASS

  Element name for a library class.

  See Also:
    Constant Field Values

### ELEM_FILE

    public static final java.lang.String ELEM_FILE

  Element name for a library file.

  See Also:
    Constant Field Values

### ELEM_REQUIRES

    public static final java.lang.String ELEM_REQUIRES

  Element name for a library class or file depedancy.

  See Also:
    Constant Field Values

### ELEM_METHOD

    public static final java.lang.String ELEM_METHOD

  Element name for a method on a library class.

  See Also:
    Constant Field Values

### ELEM_VARIABLE

    public static final java.lang.String ELEM_VARIABLE

  Element name for a variable either as a method argument or a field.

  See Also:
    Constant Field Values

### ELEM_TYPEARG

    public static final java.lang.String ELEM_TYPEARG

  Element name for a type argument or template parameter.

  See Also:
    Constant Field Values

### ELEM_PARENT

    public static final java.lang.String ELEM_PARENT

  Element name for an inheritance specification.

  See Also:
    Constant Field Values

### ELEM_LINK

    public static final java.lang.String ELEM_LINK

  Element name for a class which implements a link.

  See Also:
    Constant Field Values

### ELEM_ENGINE

    public static final java.lang.String ELEM_ENGINE

  Element name for a class which implements an engine.

  See Also:
    Constant Field Values

### ATTR_NAME

    public static final java.lang.String ATTR_NAME

  Attribute name for the element name.

  See Also:
    Constant Field Values

### ATTR_SOURCE

    public static final java.lang.String ATTR_SOURCE

  Attribute name for the source file.

  See Also:
    Constant Field Values

### ATTR_ACCESS

    public static final java.lang.String ATTR_ACCESS

  Attribute name for the access (protection) on a field.

  See Also:
    Constant Field Values

### ATTR_PROTOTYPE

    public static final java.lang.String ATTR_PROTOTYPE

  Attribute name for the prototype method flag.

  See Also:
    Constant Field Values

### ATTR_SYNCHRONIZED

    public static final java.lang.String ATTR_SYNCHRONIZED

  Attribute name for the synchronized method flag.

  See Also:
    Constant Field Values

### ATTR_TYPE

    public static final java.lang.String ATTR_TYPE

  Attribute name for the type of a variable or method.

  See Also:
    Constant Field Values

### ATTR_ARRAY

    public static final java.lang.String ATTR_ARRAY

  Attribute name for the array specifier on a variable or method.

  See Also:
    Constant Field Values

### locator

    protected org.xml.sax.Locator locator

  Locator provided by the XML parser to get line numbers and such.

### path

    protected java.lang.String path

  The path to the XML resource.

### resourceName

    protected java.lang.String resourceName

  The name of the XML resource.

### namespace

    protected Namespace namespace

  Current context during XML parsing.

### instance

    protected Instance instance

  The instance representing the element currently being parsed.

### rootNamespace

    protected Namespace rootNamespace

  The root namespace of the hierarchy.

### linkName

    protected java.lang.String linkName

  The name of the link being loaded.

### engineName

    protected java.lang.String engineName

  The name of the engine being loaded.

### cdata

    protected java.lang.String cdata

  Accumulated character data.

Constructor Detail

### Library.LibraryLoader

    public Library.LibraryLoader(java.lang.String _resourceName,
                                 boolean tryResource,
                                 Namespace _rootNamespace,
                                 java.lang.String _schemaName,
                                 Log errorLog)

  Standard constructor. Simply loads the configuration file.

  Parameters:
    `_resourceName` - The name of the resource to load as the config file.
    `tryResource` - Should the resource name be loaded as an actual resource? (as opposed to using it as a file name only).
    `_rootNamespace` - The root namespace to merge the root namespace of the file into
    `_schemaName` - The name of the resource containing the XML schema. This is always a resource, never a file.
    `errorLog` - A list of errors to be reported to the user.

Method Detail

### setDocumentLocator

    public void setDocumentLocator(org.xml.sax.Locator _locator)

  Specified by:
    `setDocumentLocator` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `setDocumentLocator` in class `org.xml.sax.helpers.DefaultHandler`
  See Also:
    `DefaultHandler.setDocumentLocator(org.xml.sax.Locator)`

### startDocument

    public void startDocument()
                       throws org.xml.sax.SAXException

  Specified by:
    `startDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startDocument` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`
  See Also:
    `DefaultHandler.startDocument()`

### endDocument

    public void endDocument()
                     throws org.xml.sax.SAXException

  Specified by:
    `endDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endDocument` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`
  See Also:
    `DefaultHandler.endDocument()`

### lookupAccess

    public Field.Access lookupAccess(java.lang.String accessName)

  Parse a given string to get the access enum that that string corresponds to.

  Parameters:
    `accessName` - The string to parse.
  Returns:
    The access level the string represents.

### lookupType

    public java.lang.Integer lookupType(java.lang.String vartype)

  Parse a simple variable type into it's internal bitwidth style representation.

  Parameters:
    `vartype` - The simple variable type to parse.
  Returns:
    The bitwidth of that type.

### lookupArray

    public int lookupArray(java.lang.String arrayBound)

  Parse an array bound specifier. If it's a star or question mark, it will be interpreted as infinite.

  Parameters:
    `arrayBound` - The string to parse.
  Returns:
    the array bound.

### startElement

    public void startElement(java.lang.String URI,
                             java.lang.String localName,
                             java.lang.String qualifiedName,
                             org.xml.sax.Attributes attributes)
                      throws org.xml.sax.SAXException

  Element start handler, responsible for creating namespaces, library classes and library files. Also responsible for populating requirements, methods and variables. In addition this method is responsible for loading link and engine generator classes.

  Specified by:
    `startElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startElement` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`
  See Also:
    `DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)`

### endElement

    public void endElement(java.lang.String URI,
                           java.lang.String localName,
                           java.lang.String qualifiedName)
                    throws org.xml.sax.SAXException

  Simple cleanup routine to handle the end of an element. Handles requirement parsing.

  Specified by:
    `endElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endElement` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`
  See Also:
    `DefaultHandler.endElement(java.lang.String, java.lang.String, java.lang.String)`

### characters

    public void characters(char[] buf,
                           int offset,
                           int len)
                    throws org.xml.sax.SAXException

  CData accumulation routine.

  Specified by:
    `characters` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `characters` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXException`
  See Also:
    `DefaultHandler.characters(char[], int, int)`

### error

    public void error(org.xml.sax.SAXParseException exception)
               throws org.xml.sax.SAXParseException

  Simply throws the exception to abort parsing.

  Specified by:
    `error` in interface `org.xml.sax.ErrorHandler`
  Overrides:
    `error` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXParseException`
  See Also:
    `ErrorHandler.error(org.xml.sax.SAXParseException)`

### fatalError

    public void fatalError(org.xml.sax.SAXParseException exception)
                    throws org.xml.sax.SAXParseException

  Simply throws the exception to abort parsing.

  Specified by:
    `fatalError` in interface `org.xml.sax.ErrorHandler`
  Overrides:
    `fatalError` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXParseException`
  See Also:
    `ErrorHandler.fatalError(org.xml.sax.SAXParseException)`

### warning

    public void warning(org.xml.sax.SAXParseException exception)
                 throws org.xml.sax.SAXParseException

  Simply throws the exception to abort parsing.

  Specified by:
    `warning` in interface `org.xml.sax.ErrorHandler`
  Overrides:
    `warning` in class `org.xml.sax.helpers.DefaultHandler`
  Throws:
    `org.xml.sax.SAXParseException`
  See Also:
    `ErrorHandler.warning(org.xml.sax.SAXParseException)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD